<?php

class BusinessAction extends BaseAction {
    public function __construct(){
		parent::__construct();
  }
  public function index()
  {
      $colorList = array('lady_lips', 'night_fade', 'deep_relief', 'warm_flame', 'dusty_grass', 'tempting_azure', 'amy_crisp' );
      $id = $_GET['id'];
      $where = array('id' => $id);
      $data = M('business')->where($where)->find();
      $childWhere = array('pid' => $id, 'is_delete' => 0, 'is_on_sale'=>1 );
      $childList = M('business')->where($childWhere)->select();
      foreach ( $childList as $k=> $v) {
        $childList[$k]['color'] = $colorList[$k];
     }
      $this->data = $data;
      $this->dataJson = json_encode($data, true);
      $this->childList = $childList;
      $this->childListJson = json_encode($childList, true);
      $this->webtitle="套餐列表";
      $this->display();
  }

  public function selectedBusiness ()
  {
      $id = $_GET['id'];
      print_r($id);
      $this->display();
  }

  public function package_detail () 
  {
    
    $this->webtitle="套餐详情";
    $this->display();
  }
     //test
  public function test()
  {
    $this->webtitle="套餐列表";
    $this->display();
  }
}